<template>
  <div>
    <!-- <img src="@/assets/img/diyi.png" alt="" class="img" /> -->
    <img
      class="img"
      v-for="(item, index) in list"
      :src="item.src"
      @click="show(index)"

    />
    <previewer
      :list="list"
      ref="previewer"
      :options="options"
      @on-index-change="logIndexChange"
    ></previewer>
  </div>
</template>
<script>
import { hospitalConfig } from "@/api/api";
import { Previewer } from "vux";
export default {
  components: {
    Previewer,
  },
  data() {
    return {
      resdata: {},
      list: [
        {
          msrc: "http://182.92.162.236:9000/ruoyi/ydkq/image/diyi.png",
          src: "http://182.92.162.236:9000/ruoyi/ydkq/image/diyi.png",
        },
      ],
      options: {
        getThumbBoundsFn(index) {

        },
      },
    };
  },
  created() {
    // this.hospitalConfig()
  },
  methods: {
    logIndexChange(arg) {
      console.log(arg);
    },
    show(index) {
      this.$refs.previewer.show(index);
    },
    hospitalConfig() {
      hospitalConfig().then((res) => {
        if (res.code == 200) {
          this.resdata = res.data;
        }
      });
    },
  },
};
</script>
<style scoped>
.img {

  width: calc(100% - 2rem);
  padding: 0 1rem;
  padding-top: 1rem;
  height: auto;
  border-radius: 0.375rem;

}
</style>
